-- CALC_MARMITE_BONUS

-- 计算砂锅奖励
-- @param user    玩家对象
return function(user)
    -- 受到伤害
    local floor = DungeonM.currentLayer();
    local damage = math.modf(0.125 * floor + 3);
    
    -- 需要延迟播放，等获得属性的动画播放完毕时再播放受创
    CombatM.receiveDamage(ME.user, ME.user, damage, 0, { delayPlay = true });
    local rand = DungeonM.getRandSeed("marmite_bonus") % 100;
    
    -- 攻击或魔力+1
    local attrib;
    if rand < 50 then
        attrib = "attack";
    else
        attrib = "magic";
    end
    local ret = {
        ["bonus"] = { { 2, attrib, 1 }, },
    };
   
    return ret;
end